//
//  HomeSearchView.m
//  LADZhangWo
//
//  Created by Apple on 16/1/18.
//  Copyright © 2016年 Apple. All rights reserved.
//

#import "HomeSearchView.h"

@implementation HomeSearchView
@synthesize imageView = _imageView;
@synthesize textField = _textField;

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.cornerRadius = 13.0;
        self.layer.masksToBounds = YES;
        self.backgroundColor = [UIColor colorWithHexString:@"0xFFB9BB"];
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 16, 16)];
        _imageView.image = [UIImage imageNamed:@"icon-search-white.png"];
        _imageView.contentMode = UIViewContentModeScaleToFill;
        [self addSubview:_imageView];
        
        _textField = [[UITextField alloc] initWithFrame:CGRectMake(31, 0, frame.size.width-40, frame.size.height)];
        _textField.placeholder = @"搜索";
        _textField.textColor = [UIColor blackColor];
        _textField.font = [UIFont systemFontOfSize:14.0];
        _textField.returnKeyType = UIReturnKeySearch;
        [_textField setValue:[UIColor blackColor] forKeyPath:@"_placeholderLabel.textColor"];
        [_textField setValue:[UIFont systemFontOfSize:14.0] forKeyPath:@"_placeholderLabel.font"];
        [self addSubview:_textField];
    }
    return self;
}


@end
